package com.consumer._02_consumer_model;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "02-boot-consumer-model",
        consumerGroup = "spring-boot-consumer-demo1",
        messageModel = MessageModel.CLUSTERING //默认就是集群模式
        //messageModel = MessageModel.BROADCASTING  //广播模式
)
public class Consumer1 implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("消费的内容1:"+message);
    }
}